// 共享类型定义

// 产品类型
export interface Product {
  id: string;
  name: string;
  categoryId: string; // 关联二级分类
  category?: string;
  description: string;
  priceRange?: string;
  priceMin?: number;
  priceMax?: number;
  mainImage?: string;
  coverImage?: string;
  images?: string[];
  detailImages?: string[];
  tags?: string[];
  features?: string[];
  materials?: string[];
  specifications?: any;
  specificationsText?: string;
  params?: string;
  details?: string;
  status: 'published' | 'draft';
  featured?: boolean;
  sort?: number;
  createdAt: string;
  updatedAt: string;
  // 新增关联数据
  processes?: ProductProcess[];
  productSpecifications?: ProductSpecification[];
}

// 产品工艺类型
export interface ProductProcess {
  id: string;
  productId: string;
  name: string;
  description?: string;
  image?: string;
  sort?: number;
  status: 'active' | 'inactive';
  createdAt: string;
  updatedAt: string;
  specifications?: ProcessSpecification[];
}

// 产品参数类型
export interface ProductSpecification {
  id: string;
  productId: string;
  name: string;
  value: string;
  unit?: string;
  category?: string;
  sort?: number;
  createdAt: string;
  updatedAt: string;
}

// 工艺参数类型
export interface ProcessSpecification {
  id: string;
  processId: string;
  name: string;
  value: string;
  unit?: string;
  sort?: number;
  createdAt: string;
  updatedAt: string;
}

// 案例类型
export interface Case {
  id: string;
  title: string;
  name?: string;
  client?: string; // 兼容字段
  clientName?: string; // 客户名称
  industryId?: string; // 关联一级分类（行业）
  category?: string;
  industry?: string; // 行业分类
  applicationScenes?: string[]; // 应用场景标签
  scenarios?: string[]; // 兼容字段
  location?: string;
  duration?: string;
  budget?: string;
  projectValue?: string; // 项目价值
  completedAt?: string;
  completedDate?: string; // 兼容字段
  projectDate?: string; // 项目日期
  year?: string;
  coverImage?: string;
  images?: string[];
  detailImages?: string[];
  description?: string;
  content?: string; // 详细内容
  background?: string; // 项目背景
  requirements?: string; // 客户需求
  projectScale?: string; // 项目规模
  services?: string[];
  highlights?: string[];
  tags?: string[];
  challenges?: string;
  solution?: string;
  solutions?: string;
  results?: string;
  testimonial?: any;
  status: 'active' | 'inactive' | 'draft';
  featured?: boolean;
  sort?: number;
  createdAt: string;
  updatedAt: string;
}

// 设置类型
export interface Setting {
  key: string;
  value: string;
  description: string;
  type: 'string' | 'number' | 'boolean' | 'json';
}

// 联系记录类型
export interface ContactLog {
  id: string;
  name: string;
  phone: string;
  company: string;
  message: string;
  source: string;
  ip: string;
  status: 'new' | 'processing' | 'completed';
  createdAt: string;
  updatedAt: string;
}

// 联系人信息类型
export interface ContactInfo {
  name: string;
  position: string;
  avatar: string;
  phone: string;
  wechat: string;
}

// 网站基本信息类型
export interface SiteInfo {
  name: string;
  address: string;
  phone: string;
  email: string;
  wechat: string;
  logo: string;
}